﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using UI2.Data;

namespace UI2.Controllers
{
    public class SportCategoriesController : Controller
    {
        SPORTSALEEntities context = new SPORTSALEEntities();

        //
        // GET: /SportCategories/

        public ActionResult Index()
        {
            return View(new List<SportCategories>());
        }

        //
        // GET: /SportCategories/Create

        public ActionResult Create()
        {
            return View();
        }

        //
        // POST: /SportCategories/Create

        [HttpPost]
        public ActionResult Create(SportCategories sp)
        {
            try
            {
                /*context.SportCategories.AddObject(sp);
                context.SaveChanges();*/

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /SportCategories/Edit/5

        public ActionResult Edit(/*int id*/)
        {
            return RedirectToAction("Index");
            //return View(context.SportCategories.ToList().Where( x => x.Id == id).FirstOrDefault());
        }

        //
        // POST: /SportCategories/Edit/5

        [HttpPost]
        public ActionResult Edit(SportCategories sp)
        {
            try
            {
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /SportCategories/Delete/5

        public ActionResult Delete(/*int id*/)
        {
            

            return View();
        }

        //
        // POST: /SportCategories/Delete/5

        [HttpPost]
        public ActionResult Delete(/*int id,*/ FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    }
}
